(function() {
  var searchGoods;

  searchGoods = function(keywords) {
    var _ref, _ref1;
    if ((_ref = document.getElementById('q')) != null) {
      _ref.value = keywords;
    }
    return (_ref1 = document.getElementById('J_TSearchForm')) != null ? _ref1.submit() : void 0;
  };

  chrome.extension.sendRequest({
    keyword: 1
  }, function(response) {
    if (response && response.buy && response.buy.keyword) {
      return setTimeout(function() {
        return searchGoods(response.buy.keyword);
      }, 4000);
    }
  });

}).call(this);
